package com.ican.dao.user;

import java.util.Date;

import org.springframework.stereotype.Repository;

import com.ican.common.hibernate.HibernateDao;
import com.ican.domain.user.RoleResources;

@Repository("roleResourcesDao")
public class RoleResourcesDao extends HibernateDao<RoleResources, Integer> {
    
    public void addRoleResources(RoleResources rs){
        rs.setCreateTime(new Date());
        this.save(rs);
    }
    
    public void removeRoleResources(RoleResources rs){
        String hql = "delete from RoleResources where roleId = ? and resourcesId = ?";
        batchExecute(hql, new Object[]{rs.getRoleId(), rs.getResourcesId()});
    }
}
